#
# Copyright 2008 Spencer Davis <SpencerDavis91@gmail.com>
#
# This file is part of Tuxedo.
#
# Tuxedo is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
# 
# Tuxedo is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
# 
# You should have received a copy of the GNU General Public License
# along with Tuxedo; if not, see <http://gnu.org/licenses/.>
#

import os
import sys
import gtk
import gtk.glade

class AboutDialog:
    """Creates the dialog that shows the program information."""
    def __init__(self):
        """Creates the dialog and shows it."""
        # Set the correct path to the glade file
        gladefile = os.path.join(os.path.dirname(sys.argv[0]), 'AboutDialog.glade')

        # Read the glade file and connect the signals
        self.widgets = gtk.glade.XML(gladefile)
        self.dialog = self.widgets.get_widget('AboutDialog')
        self.dialog.connect('response', self.destroy)

    def destroy(self, obj, data):
        """Destroys the dialog."""
        self.dialog.destroy()
